<template>
  <div>
    <div style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;">
      <div v-for="(item,index) in files" :key="item.id" style="margin-right: 20px">
        <template v-if="item.files && item.files.length > 0">
          <el-button v-for="(ite,index) in item.files" :key="index" type="text" @click="handlDownload(ite)">
            {{ ite.name }}
          </el-button>
        </template>

      </div>
    </div>
  </div>
</template>

<script>
import {downloadFile} from '@/utils/downloadFile'

export default {
  name: 'Index',
  props: {
    files: {
      type: Array,
      default() {
        return {
          files: []
        }
      }
    }
  },
  setup(props, context) {
    const handlDownload = (url) => {
      downloadFile(url.url)
    }

    return {
      handlDownload
    }
  }

}

</script>

<style scoped>
  /* @import url(); 引入css类 */
</style>
